// 03-radio.js
const util = require('util');
const EventEmitter = require('events');

function Radio(station) {
  EventEmitter.call(this);
  this.station = station;
}

util.inherits(Radio, EventEmitter);

// 定义 play 方法
Radio.prototype.play = function(station) {
  setTimeout(() => {
    this.emit('play', station);
  }, 0);
};

// 定义 stop 方法
Radio.prototype.stop = function(station) {
  setTimeout(() => {
    this.emit('stop', station);
  }, 5000);
};

module.exports = Radio;